﻿using TjZheng.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using TjZheng.Framework;

namespace TjZheng.EasyUI
{
    public static partial class QueryExtension
    {
        public static MvcHtmlString CreateQueryInfo(this HtmlHelper htmlHelper, EasyUIQueryControl objEasyUIQueryControl)
        {
            if (objEasyUIQueryControl == null)
            {
                throw new Exception("查询控件不能为空");
            }
            return MvcHtmlString.Create(objEasyUIQueryControl.ToString());
        }
        public static MvcHtmlString CreateQueryInfo(this HtmlHelper htmlHelper, string name, QueryMethod objQueryMethod, QueryDataType objQueryDataType)
        {
            QueryInfo objQueryInfo = new QueryInfo()
            {
                QueryField = name,
                QueryMethod = objQueryMethod,
                QueryDataType = objQueryDataType
            };
            return htmlHelper.CreateQueryInfo(objQueryInfo);
        }
    }
}
